package com.qlylkj.lbk.ui.news

import android.widget.ImageView
import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.forest.core.etx.load
import com.qlylkj.lbk.R
import com.qlylkj.lbk.app.addHost
import com.qlylkj.lbk.model.bean.News

class NewsAdapter: BaseQuickAdapter<News,BaseViewHolder>(R.layout.item_news) {

    override fun convert(helper: BaseViewHolder, item: News?) {
        helper.run {
            item?.run {
                val newsImage = getView<ImageView>(R.id.newsImage)
                newsImage.load(mContext,faceImg.addHost(), RequestOptions().placeholder(R.mipmap.ic_conver_default))
                setText(R.id.newsTitleText,title)
                setText(R.id.newsTimeText,createTime)
            }
        }
    }
}